﻿
/*----------------------------------------------------------------//
// 文件名：MoNoticeReceiver.cs
// 文件功能描述：实体 MoNoticeReceiver.
// 
// 创建标识：2009-02-27
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoNoticeReceiver
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoNoticeReceiver
	/// </summary>
	public partial class MoNoticeReceiver:ICloneable
	{
		#region 表NoticeReceiver的字段
		private int _rec_id;
		private string _uid;
		private string _notice_id;
		private int _rec_status;
		private DateTime _rec_time;
		#endregion
		
		#region 构造函数
		public MoNoticeReceiver()
		{
		    
		    
		    
		    
		    _rec_time= DateTime.Now;
		}
		#endregion
		
		#region 拷贝构造函数

		public MoNoticeReceiver(MoNoticeReceiver item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoNoticeReceiver(int rec_id,string uid,string notice_id,int rec_status,DateTime rec_time)
		{
		this._rec_id=rec_id;
		this._uid=uid;
		this._notice_id=notice_id;
		this._rec_status=rec_status;
		this._rec_time=rec_time;
		}
		#endregion
		
		#region 表NoticeReceiver的字段属性
		/// <summary>
		/// REC_ID
		/// </summary>
		public int Rec_Id
		{
			get {return _rec_id;}
			set {_rec_id=value;}
		}
		/// <summary>
		///用户ID默认等于人员编码。如： 人员序号1，人员编码 E0001,姓名 张明   对应用户表 的用户ID就是E0001.
		/// </summary>
		public string Uid
		{
			get {return _uid;}
			set {_uid=value;}
		}
		/// <summary>
		///使用GUID实现；
		/// </summary>
		public string Notice_Id
		{
			get {return _notice_id;}
			set {_notice_id=value;}
		}
		/// <summary>
		///0=发布未读，1=已读 ，2=已删除
		/// </summary>
		public int Rec_Status
		{
			get {return _rec_status;}
			set {_rec_status=value;}
		}
		/// <summary>
		/// REC_TIME
		/// </summary>
		public DateTime Rec_Time
		{
			get {return _rec_time;}
			set {_rec_time=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoNoticeReceiver CopyTo(MoNoticeReceiver item)
        {
		    item.Rec_Id=this.Rec_Id;
		    item.Uid=this.Uid;
		    item.Notice_Id=this.Notice_Id;
		    item.Rec_Status=this.Rec_Status;
		    item.Rec_Time=this.Rec_Time;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoNoticeReceiver NewNoticeReceiver=new MoNoticeReceiver();
		    NewNoticeReceiver._rec_id=this._rec_id;
		    NewNoticeReceiver._uid=this._uid;
		    NewNoticeReceiver._notice_id=this._notice_id;
		    NewNoticeReceiver._rec_status=this._rec_status;
		    NewNoticeReceiver._rec_time=this._rec_time;
			return NewNoticeReceiver;
		}
		
		private static MoNoticeReceiver _empty = new MoNoticeReceiver(-1,string.Empty,string.Empty,-1,DateTime.MinValue);
        public static MoNoticeReceiver Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoNoticeReceiver NewNoticeReceiver = obj as MoNoticeReceiver;
                if (NewNoticeReceiver == null)
                {
                    return false;
                }
                else
                {
				if (NewNoticeReceiver.Rec_Id==this.Rec_Id && NewNoticeReceiver.Uid==this.Uid && NewNoticeReceiver.Notice_Id==this.Notice_Id && NewNoticeReceiver.Rec_Status==this.Rec_Status && NewNoticeReceiver.Rec_Time==this.Rec_Time)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Rec_Id={0}/Uid={1}/Notice_Id={2}/Rec_Status={3}/Rec_Time={4}",_rec_id,_uid,_notice_id,_rec_status,_rec_time);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["Rec_ID"]!=null && row["Rec_ID"]!=DBNull.Value)
			{
			    this.Rec_Id = (int)row["Rec_ID"];
			}
			else
			{
				this.Rec_Id =-1;
			}
		    if(row["UID"]!=null && row["UID"]!=DBNull.Value)
			{
			    this.Uid = (string)row["UID"];
			}
			else
			{
				this.Uid =string.Empty;
			}
		    if(row["Notice_ID"]!=null && row["Notice_ID"]!=DBNull.Value)
			{
			    this.Notice_Id = (string)row["Notice_ID"];
			}
			else
			{
				this.Notice_Id =string.Empty;
			}
		    if(row["Rec_Status"]!=null && row["Rec_Status"]!=DBNull.Value)
			{
			    this.Rec_Status = (int)row["Rec_Status"];
			}
			else
			{
				this.Rec_Status =-1;
			}
		    if(row["Rec_Time"]!=null && row["Rec_Time"]!=DBNull.Value)
			{
			    this.Rec_Time = (DateTime)row["Rec_Time"];
			}
			else
			{
				this.Rec_Time =DateTime.MinValue;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["Rec_ID"] = this.Rec_Id;
			row["UID"] = this.Uid;
			row["Notice_ID"] = this.Notice_Id;
			row["Rec_Status"] = this.Rec_Status;
			row["Rec_Time"] = this.Rec_Time;
		}
		#endregion
	}
}
#endregion
